<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.AppConstant" %>
<%@ page import="com.wlcorp.forcazamis.domain.confirm.Confirm" %>
<%@ page import="com.wlcorp.forcazamis.domain.confirm.ConfirmDetail" %>
<%@ page import="com.wlcorp.forcazamis.domain.system.Staff" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.SessionValue" %>
<%@ page import="com.wlcorp.forcazamis.domain.storageout.StorageOut" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.CommonUtil" %>

<%
	Confirm confirm = (Confirm)request.getAttribute("confirm");
	StorageOut storageOut = (StorageOut)request.getAttribute("item");
	Staff staff = SessionValue.getInstance(request).getStaff();
%>
<html>
<head>
	<title>样品出库单审批</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">
	<link href="${pageContext.request.contextPath}/css/css.css" rel=stylesheet>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/button_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/form_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/table_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/pagetitle_css.css" type="text/css">
	<script language="javascript" src="${pageContext.request.contextPath}/script/validator.js"></script>
	<script language="javascript" src="${pageContext.request.contextPath}/script/calendartime.js"></script>
	<script language="javascript" src="${pageContext.request.contextPath}/script/ajax.js"></script>
	<script type="text/javascript">
		function doSave(){
			document.forms["confirmForm"].submit();
		}
		
		function storageDetail(storageOutId){
			window.open("${pageContext.request.contextPath}/storageout/storageOutManager.do?method=getStorageOutDetail&storageOutId=" + storageOutId);
		}
	</script>
</head>
<body>

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="30">
	<tr> 
	  <td width="22" class="page_titlebar_head">&nbsp;</td>
	  <td class="page_titlebar_bg" width="981">样品出库单审批</td>
	</tr>
</table>
<table width="100%" class="InputFrameMain" cellspacing="0" cellpadding="0" border="0" height="100">
  <tr> 
    <td colspan="6" class="table_unfold_titlebar_small_bg">&nbsp;&nbsp;<b>样品出库单</b></td>
  </tr>
  <tr class="InputFrameLine">
        <td class="table_label" width="15%">仓库名称：</td>
		<td width="17%">样品库
		</td>
		 <td class="table_label" width="15%">入库人：</td>
		<td width="17%"><%=storageOut.getSubmiter().getStaffName()%>
		</td>
		 <td class="table_label" width="15%">出库时间：</td>
		<td width="17%"><%=storageOut.getOutStorageDate()%>
		</td>
  </tr>
  <tr class="InputFrameLine">
        <td class="table_label" width="15%" id="memo_TEXT">备注：</td>
		<td width="85%" colspan="3"><%=CommonUtil.nullToStr(storageOut.getMemo())%>
		</td>
  </tr>
  <tr class="InputFrameLine">
  	<td width="100%" colspan="6" align="center"><input type="button" class="button_common_5" name="baseInfoButton" value="查看" onclick="javascript:storageDetail('<%=storageOut.getStorageOutId()%>')"/>
  	<td>
  </tr>
</table>
<form name="confirmForm" method="POST" action="${pageContext.request.contextPath}/confirm/confirmManager.do?method=submitConfirmDetail">
<input type="hidden" name="confirmId" value="${confirm.confirmId}"/>
<table id="" width="98%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
      <tr bgcolor="#E7E7E7">
        <td>审批人</td>
        <td>职位</td>
        <td>审批时间</td>
        <td>审批结果</td>
        <td>审批意见</td>
      </tr>
      <%
      	//System.out.println(confirm.getConfirmSampleSet().size());
      	if(null != confirm.getConfirmDetailSet() && confirm.getConfirmDetailSet().size() > 0){
      		for(Iterator iter = confirm.getConfirmDetailSet().iterator();iter.hasNext();){
      			ConfirmDetail confirmDetail = (ConfirmDetail)iter.next();
      			
      %>
      <tr id="<%=confirmDetail.getId()%>" bgcolor="#ffffff">
      	<td><%=confirmDetail.getConfirmer().getStaffName()%></td>
        <td><%=confirmDetail.getConfirmer().getRole().getRoleName()%></td>
        <td><%=confirmDetail.getConfirmDate()%></td>
        <td><%=confirmDetail.getConfirmResultName()%></td>
        <td><%=CommonUtil.nullToStr(confirmDetail.getMemo())%></td>
	  </tr>
	  <%}}%>
</table>
<%
	if(AppConstant.CONFIRM_STATE_CONFIRMED != confirm.getState()){
%>
<table width="100%" class="InputFrameMain" cellspacing="0" cellpadding="0" border="0" height="100">
  <tr> 
    <td colspan="6" class="table_unfold_titlebar_small_bg">&nbsp;&nbsp;<b>您的审批意见 - [<%=staff.getStaffName()%>]</b></td>
  </tr>
  <tr class="InputFrameLine">
        <td class="table_label" width="20%">是否通过：</td>
		<td width="30%"><input type="radio" name="confirmResult" value="<%=AppConstant.CONFIRM_RESULT_PASS%>" checked/>通过
		<input type="radio" name="confirmResult" value="<%=AppConstant.CONFIRM_RESULT_NOT_PASS%>"/>不通过
		</td>
		 <td class="table_label" width="20%">审批人：</td>
		<td width="30%"><%=staff.getStaffName()%>
		</td>
  </tr>
  <tr class="InputFrameLine">
        <td class="table_label" width="20%" id="memo_TEXT">审批意见：</td>
		<td width="80%" colspan="3">&nbsp;<textarea id="memo" name="memo" cols="40" rows="5" style="width:400px"></textarea>
		</td>
  </tr>
  <tr class="InputFrameLine">
  	<td width="100%" colspan="4" align="center"><input type="button" class="button_common_5" name="baseInfoButton" value="提交" onclick="javascript:document.forms['confirmForm'].submit();"/>
  	<td>
  </tr>
</table>
<%}%>
</form>
${message}
</body>
</html>
